<?php



namespace App\Services\Business\Models;

use Illuminate\Database\Eloquent\Model;
use App\Services\Business\Models\TagCategory;

class Tag extends Model {
    protected $table = 'tag';

    protected $fillable = [
        'id',
        'category_id',
        'name'
    ];

    public function category()
    {
        return $this->belongsTo(TagCategory::class, 'category_id');
    }
    public function articles()
    {
        return $this->morphedByMany(Article::class, 'taggable');
    }

    public function videos()
    {
        return $this->morphedByMany(Video::class, 'taggable');
    }


}
